package util;

import java.io.PrintWriter;

/**
 * @author Egor Kulikov (kulikov@devexperts.com)
 */
public class ArrayUtil {
	public static void reverseArray(int[] array) {
		int lastIndex = array.length - 1;
		for (int i = array.length / 2 - 1; i != -1; i--) {
			int temp = array[i];
			array[i] = array[lastIndex - i];
			array[lastIndex - i] = temp;
		}
	}

	public static void printArray(int[] array, PrintWriter out) {
		if (array.length == 0) {
			out.println();
			return;
		}
		out.print(array[0]);
		for (int i = 1; i < array.length; i++)
			out.print(" " + array[i]);
		out.println();
	}
}
